clear all
load W_time1_age0_eh1_comp11.out
n = 50;
w_f_g=W_time1_age0_eh1_comp11; % Read wages, g and f distributions
wf_1=w_f_g(:,1);        % Wage in formal sector
wi_1=w_f_g(:,2);        % Wage in informal sector
wf_2=w_f_g(:,7);      % Wage in formal sector
wi_2=w_f_g(:,8);      % Wage in informal sector

load fitted_model

% may need smoothing (keep up to 95h-99th percentile of prod.)
p_f_1s=smoothdata(p_f_1(1:25),'rlowess',20);
p_i_1s=smoothdata(p_i_1(1:18),'rlowess',20);
p_f_2s=smoothdata(p_f_2(1:25),'rlowess',20);
p_i_2s=smoothdata(p_i_2(1:18),'rlowess',20);

% figure: formal sector men
figure(1)
subplot(2,2,1)
plot(log(p_f_1s),log(wf_1(1:25)),'-b','LineWidth',2.5)
 
xlabel('log(productivity)','FontSize',10)
ylabel('log(wage)','FontSize',10)
ylim([7 10])
xlim([8 10.5])
title('formal sector - men')

% figure: formal sector women
subplot(2,2,2)
plot(log(p_f_2s),log(wf_2(1:25)),'-b','LineWidth',2.5)
 
xlabel('log(productivity)','FontSize',10)
ylabel('log(wage)','FontSize',10)
ylim([7 10])
xlim([8 10.5])
title('formal sector - women')

% figure: informal sector men
figure(1)
subplot(2,2,3)
plot(log(p_i_1s),log(wi_1(1:18)),'-b','LineWidth',2.5)
 
xlabel('log(productivity)','FontSize',10)
ylabel('log(wage)','FontSize',10)
ylim([7 10])
xlim([8 10.5])
title('informal sector - men')

% figure: informal sector women
subplot(2,2,4)
plot(log(p_i_2s),log(wi_2(1:18)),'-b','LineWidth',2.5)
 
xlabel('log(productivity)','FontSize',10)
ylabel('log(wage)','FontSize',10)
ylim([7 10])
xlim([8 10.5])
title('informal sector - women')

print -dpdf productivity_wage_eh1_comp1.pdf




